package poo;

public class Coche {

    private String matricula;

    public Coche(String string) {
        matricula = string;
    }

    public Coche() {
        matricula="--------";
    }

    public String getMatricula() {
        return matricula;
    }

    public void setMatricula(String matricula) {
        this.matricula = matricula;
    }
    
    public void acelerar(){
        System.out.println("Aceleramos suave.");
    }

    public static void main(String[] args) {
        Coche c = new Coche();
        Coche c1 = new Coche("1234-qwe");
        Deportivo d = new Deportivo();
        Deportivo d1 = new Deportivo("1234-ttt");
        Utilitario u = new Utilitario();
        Utilitario u1 = new Utilitario("1234-zzz");
        
        Coche c2 = d;
        c2=u;
        /*
        Deportivo d2 = c;
        d2 = u;
        u = d2;
         */
        
        System.out.println(d1.getMatricula());
        System.out.println(u1.getMatricula());
        
        c1.acelerar();
        d1.acelerar();
        u1.acelerar();
        
    }
}
